//
// Copyright (c) 2024 BPer
//
#ifndef BPERCAPTURE_WIN_API_BPERCAPTUREAUDIODATA_H_
#define BPERCAPTURE_WIN_API_BPERCAPTUREAUDIODATA_H_

#include <bperaudiodev/BPerCaptureCallback.h>
#include <bperutil/BPerAvType.h>
#include <bperavutil/audio/BPerAudioUtil.h>
#include <bperavutil/audio/BPerRtcAec.h>
#include <bperutil/buffer/BPerAudioBuffer.h>
class BPerAudioCaptureData {
public:
	BPerAudioCaptureData();
	virtual ~BPerAudioCaptureData();
	void initIn(int psample,int pchannel);
	void initOut(int psample,int pchannel);
	void caputure(BPerFrame* audioFrame);
	int getOutLength();
	BPerCaptureCallback* m_cb;

private:
	uint8_t* m_cache;
	int m_cacheLen;
	int m_size;
	int m_pos;

private:
	BPerAudioResample m_res;
	BPerFrame m_audioFrame;

	void captureData();
};

#endif /* BPERCAPTURE_WIN_API_BPERCAPTUREAUDIODATA_H_ */
